﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace 计科201518彭康
{
    public partial class 实验1_4 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            quyu();
        }

        protected void quyu()
        {
            DropDownList2.Items.Clear();
            if (DropDownList1.SelectedValue =="北京")
            {
                DropDownList2.Items.Add(new ListItem("昌平区" ,"01"));
                DropDownList2.Items.Add(new ListItem("朝阳区", "02"));
                DropDownList2.Items.Add(new ListItem("大兴区", "03"));
                DropDownList2.Items.Add(new ListItem("海淀区", "04"));
                DropDownList2.Items.Add(new ListItem("怀柔区", "05"));

            }
            if (DropDownList1.SelectedValue == "天津")
            {
                DropDownList2.Items.Add(new ListItem("津南区", "01"));
                DropDownList2.Items.Add(new ListItem("河西区", "02"));
                DropDownList2.Items.Add(new ListItem("河东区", "03"));
                DropDownList2.Items.Add(new ListItem("河北区", "04"));
                DropDownList2.Items.Add(new ListItem("南开区", "05"));

            }
            if (DropDownList1.SelectedValue == "上海")
            {
                DropDownList2.Items.Add(new ListItem("黄浦区", "01"));
                DropDownList2.Items.Add(new ListItem("静安区", "02"));
                DropDownList2.Items.Add(new ListItem("嘉定区", "03"));
                DropDownList2.Items.Add(new ListItem("普陀区", "04"));
                DropDownList2.Items.Add(new ListItem("浦东新区", "05"));

            }
        }
    }
}